package com.wk.wechattool.tool;

import android.app.Activity;
import android.content.Context;
import android.util.DisplayMetrics;
import android.view.WindowManager;


public class MyDeviceInforHelper {
	public static WindowManager myWindowManager ;
	public static DisplayMetrics myDisplayMetrics ;

	public static WindowManager myGetWindowManageger(Context context) {
		if(myWindowManager==null){
			myWindowManager = (WindowManager) (context.getSystemService(Context.WINDOW_SERVICE));
		}
		return myWindowManager;
	}
	private static DisplayMetrics myGetDisplayMetrics( ) {
		if(myDisplayMetrics==null){
			myDisplayMetrics = new DisplayMetrics();
		}
		return myDisplayMetrics;
	}




	public static int getHeight(Activity mActivity) {
		mActivity.getWindowManager().getDefaultDisplay().getMetrics(myGetDisplayMetrics());
		return  myGetDisplayMetrics().heightPixels;

	}


	public static int getWindowHeigh(Context context) {
		myGetWindowManageger(context).getDefaultDisplay().getMetrics(myGetDisplayMetrics());
		return myGetDisplayMetrics().heightPixels;
	}



}
